using System.Windows.Controls;
using System.Windows;
using AvalonDock.Layout;
using Sany.AGV.RobotTool.ViewModels;

namespace Sany.AGV.RobotTool
{
	class PanesTemplateSelector : DataTemplateSelector
	{
		public PanesTemplateSelector()
		{
		}

		public DataTemplate DocumentViewTemplate
		{
			get;
			set;
		}

		public DataTemplate PropertyViewTemplate
		{
			get;
			set;
		}

		public DataTemplate SolutionViewTemplate
		{
			get;
			set;
		}

		public DataTemplate DebugViewTemplate
		{
			get;
			set;
		}

		public DataTemplate OutputViewTemplate
		{
			get;
			set;
		}

		public DataTemplate NotificationViewTemplate
		{
			get;
			set;
		}

		public DataTemplate ToolboxViewTemplate
		{
			get;
			set;
		}

		public override DataTemplate SelectTemplate(object item, DependencyObject container)
		{
			var itemAsLayoutContent = item as LayoutContent;

			if (item is DocumentViewModel)
				return DocumentViewTemplate;

			if (item is PropertyViewModel)
				return PropertyViewTemplate;

			if (item is SolutionViewModel)
				return SolutionViewTemplate;

			if (item is DebugViewModel)
				return DebugViewTemplate;

			if (item is OutputViewModel)
				return OutputViewTemplate;

			if (item is NotificationViewModel)
				return NotificationViewTemplate;

			if (item is ToolboxViewModel)
				return ToolboxViewTemplate;

			return base.SelectTemplate(item, container);
		}
	}
}
